﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;
using System.Globalization;
//using System.Web.Security;

namespace GuiaVinum.Model
{
    [Table("UserProfile")]
    public class UserProfile
    {
        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public int UserId { get; set; }
        [Display(Name="UserName",ResourceType=typeof(GuiaVinum.Recursos.Global))]
        public string UserName { get; set; }
        [Display(Name = "Apellido", ResourceType = typeof(GuiaVinum.Recursos.Global))]
        public string Apellido { get; set; }
        [Display(Name = "Nombre", ResourceType = typeof(GuiaVinum.Recursos.Global))]
        public string Nombre { get; set; }
        [Display(Name = "Email", ResourceType = typeof(GuiaVinum.Recursos.Global))]
        public string Email { get; set; }
        [Display(Name = "Telefono", ResourceType = typeof(GuiaVinum.Recursos.Global))]
        public string Telefono { get; set; }
        [Display(Name = "Pais", ResourceType = typeof(GuiaVinum.Recursos.Global))]
        public Pais Pais { get; set; }
        [Display(Name = "Provincia", ResourceType = typeof(GuiaVinum.Recursos.Global))]
        public string Provincia { get; set; }
        [Display(Name = "Localidad", ResourceType = typeof(GuiaVinum.Recursos.Global))]
        public string Localidad { get; set; }
        [Display(Name = "Direccion", ResourceType = typeof(GuiaVinum.Recursos.Global))]
        public string Direccion { get; set; }
        [Display(Name = "FechaNacimiento", ResourceType = typeof(GuiaVinum.Recursos.Global))]
        public DateTime? FechaNacimiento { get; set; }
        [Display(Name = "ExperienciaUsuario", ResourceType = typeof(GuiaVinum.Recursos.Global))]
        public ExperienciaUsuario ExperienciaUsuario { get; set; }
        [Display(Name = "FechaRegistro", ResourceType = typeof(GuiaVinum.Recursos.Global))]
        public DateTime FechaRegistro { get; set; }
    }

    public class RegisterExternalLoginModel
    {
        [Required]
        [Display(Name = "UserName", ResourceType = typeof(GuiaVinum.Recursos.Global))]
        public string UserName { get; set; }

        public string ExternalLoginData { get; set; }
    }

    public class LocalPasswordModel
    {
        [Required]
        [DataType(DataType.Password)]
        [Display(Name = "Current_password", ResourceType = typeof(GuiaVinum.Recursos.Global))]
        public string OldPassword { get; set; }

        [Required]
        [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "New_password", ResourceType = typeof(GuiaVinum.Recursos.Global))]
        public string NewPassword { get; set; }

        [DataType(DataType.Password)]
        [Display(Name = "Confirm_password", ResourceType = typeof(GuiaVinum.Recursos.Global))]
        [Compare("NewPassword", ErrorMessageResourceName = "Error_NewAndOldPasswordMismatch", ErrorMessageResourceType = typeof(GuiaVinum.Recursos.Global))]
        public string ConfirmPassword { get; set; }
    }

    public class LoginModel
    {
        [Required]
        [Display(Name = "UserName", ResourceType = typeof(GuiaVinum.Recursos.Global))]
        public string UserName { get; set; }

        [Required]
        [DataType(DataType.Password)]
        [Display(Name = "Password", ResourceType = typeof(GuiaVinum.Recursos.Global))]
        public string Password { get; set; }

         [Display(Name = "Recordarme", ResourceType = typeof(GuiaVinum.Recursos.Global))]
        public bool RememberMe { get; set; }
    }

    public class RegisterModel
    {
        [Required]
        [Display(Name = "UserName", ResourceType = typeof(GuiaVinum.Recursos.Global))]
        public string UserName { get; set; }

        [Required]
        [Display(Name = "Email", ResourceType = typeof(GuiaVinum.Recursos.Global))]
        public string Email { get; set; }

        [Required]
        [StringLength(100, ErrorMessageResourceName = "Validation_PasswordLength", ErrorMessageResourceType = typeof(GuiaVinum.Recursos.Global), MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "Password", ResourceType = typeof(GuiaVinum.Recursos.Global))]
        public string Password { get; set; }

        [DataType(DataType.Password)]
        [Compare("Password", ErrorMessageResourceName = "Error_PasswordAndOldPasswordMismatch", ErrorMessageResourceType = typeof(GuiaVinum.Recursos.Global))]
        [Display(Name = "Confirm_Password", ResourceType = typeof(GuiaVinum.Recursos.Global))]
        public string ConfirmPassword { get; set; }
    }

    public class ExternalLogin
    {
        public string Provider { get; set; }
        public string ProviderDisplayName { get; set; }
        public string ProviderUserId { get; set; }
    }
}
